package com.open.capacity.finance.controller;

import java.util.Map;

import com.open.capacity.commons.Result;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.security.access.prepost.PreAuthorize;
import com.open.capacity.finance.entity.AuditModelWarnLog;
import com.open.capacity.finance.service.AuditModelWarnLogService;
import javax.validation.Valid;
import com.open.capacity.commons.PageResult;

/**
 * 模型指标告警
 *
 * @author 
 * @email 
 * @date 2023-04-11 14:05:58
 */
@RestController
@RequestMapping("auditmodelwarnlogs")
@Api(tags = "模型指标告警")
public class AuditModelWarnLogController {

    @Autowired
    private AuditModelWarnLogService auditModelWarnLogService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @PreAuthorize("hasAnyAuthority('audit_model_warn_log:auditmodelwarnlog:list')")
    public PageResult list(@RequestParam Map<String, Object> params) {
        PageResult pageResult = auditModelWarnLogService.pageAll(params);
        return pageResult;
    }

    /**
    * 查询单条记录
    */
    @RequestMapping("/findById")
    @PreAuthorize("hasAnyAuthority('audit_model_warn_log:auditmodelwarnlog:list')")
    public Result findById(String id) {
        return Result.succeed(auditModelWarnLogService.findById(id));
    }


    /**
     * 删除
     */
    @RequestMapping("/delete/{id}")
    @PreAuthorize("hasAnyAuthority('audit_model_warn_log:auditmodelwarnlog:delete')")
    public Result delete(@PathVariable String  id) {
            auditModelWarnLogService.delete(id);
        return Result.succeed("删除成功");
    }

}
